package com.hmall.util;

import com.hdmall.business.common.common.Const;
import com.hmall.model.MallOrder;

/**
 * @ClassName MerchUtil
 * @Description //
 * @Author zhoutao
 * @Date 2018/11/5 14:12
 * @Version 2.0
 **/
public class MerchUtil {

    public static  String getDetailStatus(Integer userId, Integer deptId, Integer roleId, MallOrder mallOrder){
        String detailStatus = "";
        if(null != deptId && Const.MERCH_DEPT_ID.equals(deptId)){
            if(mallOrder.getStatus2() == 1){
                detailStatus = "待发货";
            }else if(mallOrder.getStatus2() == 0 && mallOrder.getStatus3() == 0){
//                detailStatus = "待审核（资金专员未审核）";
                detailStatus = "待审核（跟单员未审核）";
            }else if(mallOrder.getStatus2() == 0){
                detailStatus = "待审核";
            }else if(mallOrder.getStatus2() == 2){
                detailStatus = "审核驳回";
            }
        }else if(null != roleId && Const.FINANCE_ROLE.equals(roleId)){
            if(mallOrder.getStatus3() == 0){
                detailStatus = "待审核";
            }else if(mallOrder.getStatus3() == 1){
                detailStatus = "待发货";
            }else if(mallOrder.getStatus3() == 2){
                detailStatus = "审核驳回";
            }

        }else{
            if(mallOrder.getStatus1() == 0){
                detailStatus = "待审核";
            }else if(mallOrder.getStatus1() == 3 && mallOrder.getStatus2() == 2){
                detailStatus = "待审核（跟单员驳回）";
            }else if(mallOrder.getStatus1() == 3 && mallOrder.getStatus3() == 2){
                detailStatus = "待审核（资金专员驳回）";
            }else {
                detailStatus = "待审核（跟单员审核中）";
            }
        }
        return detailStatus;
    }
}
